import Home from '../views/Home/Home';
import MusicLibrary from '../views/MusicLibrary/MusicLibrary';
import Explore from '../views/Explore/Explore';
import Login from '../views/Login/Login';
import Setting from '../views/Setting/Setting';
import Account from '../views/Login/children/Account';
import UserName from '../views/Login/children/UserName';
import Qr from '../views/Login/children/Qr';
import DailySongs from '../views/Daily/Songs';
import PlayList from '../views/playList/playList';
import MV from '../views/MusicLibrary/MV';

const routes = [
  {
    path: '/home',
    name: 'home',
    title: '首页',
    component: Home,
  },
  {
    path: '/dailySongs',
    name: 'dailySongs',
    component: DailySongs,
    meta: { requireLogin: true },
  },
  {
    path: '/playList',
    name: 'playList',
    component: PlayList,
  },
  {
    path: '/explore',
    name: 'explore',
    title: '发现',
    component: Explore,
  },
  {
    path: '/musicLibrary',
    name: 'musicLibrary',
    title: '音乐库',
    component: MusicLibrary,
    // 定义属性表示需要登录才能访问的页面
    meta: { requireLogin: true },
  },
  {
    path: '/mv',
    name: 'mv',
    component: MV,
    // 定义属性表示需要登录才能访问的页面
    meta: { requireLogin: true },
  },
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
    children: [
      {
        path: 'account',
        name: 'account',
        component: Account,
      },
      {
        path: 'username',
        name: 'username',
        component: UserName,
      },
      {
        path: 'qr',
        name: 'qr',
        component: Qr,
      },
    ],
  },
  {
    path: '/setting',
    name: 'setting',
    component: Setting,
  },
];

export default routes;
